import { request } from "@/utils/request";
// 频道列表
export function fetchChannelsApi(data) {
  return request({
    url: "/channels",
    method: "get",
  });
}

// 获取文章列表

export function getArticleListApi(params) {
  return request({
    url: "/mp/articles",
    method: "get",
    params,
  });
}
// 删除
export function delArticleApi(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "delete",
  });
}

// 获取文章详情
export function getArticleById(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "get",
  });
}
// 更新文章表单
export function updateArticleApi(data) {
  return request({
    url: `/mp/articles/${data.id}?draft=false`,
    method: "put",
    data
  });
}
